The fs.readdir() method is used to read the contents of a directory. It returns an array of file and directory names present in the specified directory.
fs.readdir()